<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:af="http://myfaces.apache.org/trinidad"
	xmlns:afh="http://myfaces.apache.org/trinidad/html"
    xmlns:ppc="http://www.sungard.de/carnot/web/portal-plugin/common">
    
    <c:if test="#{empty showStructuredTypeAsTextField}">
        <c:set var="showStructuredTypeAsTextField" value="false"/>
    </c:if>

	<af:selectBooleanCheckbox
		selected="#{fieldModel.booleanValue}"
		disabled="#{fieldModel.disabled}" label="#{fieldModel.label}:"
		rendered="#{fieldModel.type eq 'Boolean'}" styleClass="genericInputFieldStyle"/>
	<af:inputText label="#{fieldModel.label}:"
		disabled="#{fieldModel.disabled}" value="#{fieldModel.longValue}"
		rendered="#{fieldModel.type eq 'Long'}"
        styleClass="genericInputFieldStyle">
	</af:inputText>
	<af:inputText label="#{fieldModel.label}:"
		disabled="#{fieldModel.disabled}" value="#{fieldModel.doubleValue}"
		rendered="#{fieldModel.type eq 'Double'}"
        styleClass="genericInputFieldStyle">
	</af:inputText>
	<af:inputDate label="#{fieldModel.label}:"
		disabled="#{fieldModel.disabled}" value="#{fieldModel.dateValue}"
		rendered="#{fieldModel.type eq 'TimeStamp'}"
        styleClass="genericInputFieldStyle">
		<af:convertDateTime type="both" />
	</af:inputDate>
	<af:inputText label="#{fieldModel.label}:"
      disabled="#{fieldModel.disabled}" value="#{fieldModel.dateValue}"
      rendered="#{fieldModel.type eq 'Time'}"
      styleClass="genericInputFieldStyle">
      <af:convertDateTime type="time" />
    </af:inputText>
	<af:inputText label="#{fieldModel.label}:"
		disabled="#{fieldModel.disabled}" value="#{fieldModel.stringValue}"
		rendered="#{fieldModel.type eq 'String'}" 
        styleClass="genericInputFieldStyle"/>
    <af:selectOneChoice label="#{fieldModel.label}:"
        disabled="#{fieldModel.disabled}" readOnly="#{fieldModel.disabled}"
        value="#{fieldModel.longValue}" unselectedLabel="#{commonMsg.allPriorities}"
        shortDesc="#{commonMsg.chooseFilterValue}"
        rendered="#{fieldModel.type eq 'Priority'}"
        styleClass="genericInputFieldStyle">
        <af:selectItem label="#{ppc:priorityLabel(1)}" value="1"/>
        <af:selectItem label="#{ppc:priorityLabel(0)}" value="0"/>
        <af:selectItem label="#{ppc:priorityLabel(-1)}" value="-1"/>
    </af:selectOneChoice>
    <af:group rendered="#{fieldModel.type eq 'Structured' and not showStructuredTypeAsTextField}">
        <af:panelCaptionGroup
            disabled="#{fieldModel.disabled}" binding="#{fieldModel.panel}"
            captionText="#{fieldModel.label}"/>            
    </af:group>
    <af:inputText label="#{fieldModel.label}:"
        disabled="#{fieldModel.disabled}" value="#{fieldModel.stringValue}"
        rendered="#{fieldModel.type eq 'Structured' and showStructuredTypeAsTextField}" 
        styleClass="genericInputFieldStyle"/>
</ui:composition>
